//
//  XLNearbyUserCell.m
//  XiangLove
//
//  Created by 李传坤 on 2018/8/27.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLNearbyUserCell.h"

@implementation XLNearbyUserCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setupView];
    }
    return self;
}
- (void)setupView{
    _headerImageView = [[UIImageView alloc] init];
    _headerImageView.layer.cornerRadius = 5;
    _headerImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:_headerImageView];
    [_headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(66, 66));
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.centerY.equalTo(self.contentView);
    }];
    
    _nickNameLabel = [[UILabel alloc] init];
    _nickNameLabel.font = [UIFont systemFontOfSize:17];
    _nickNameLabel.textColor = RGB_HEX(0x111111);
    [self.contentView addSubview:_nickNameLabel];
    [_nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headerImageView.mas_right).offset(10);
        make.top.equalTo(self.contentView.mas_top).offset(20);
        make.right.equalTo(self.contentView.mas_right).offset(-50);
    }];
    
    _ageLabel = [[UILabel alloc] init];
    _ageLabel.font = [UIFont systemFontOfSize:10];
    _ageLabel.textAlignment = NSTextAlignmentLeft;
    _ageLabel.textColor = RGB_HEX(0xffffff);
    _ageLabel.layer.cornerRadius = 8;
    _ageLabel.clipsToBounds = YES;
    [self.contentView addSubview:_ageLabel];
    
    self.sexImage = [[UIImageView alloc]init];
    [self.contentView addSubview:_sexImage];
    
    _nvshenLabel = [[UILabel alloc] init];
    _nvshenLabel.font = [UIFont systemFontOfSize:10];
    _nvshenLabel.textAlignment = NSTextAlignmentLeft;
    _nvshenLabel.textColor = RGB_HEX(0xffffff);
    _nvshenLabel.layer.cornerRadius = 8;
    _nvshenLabel.clipsToBounds = YES;
    [self.contentView addSubview:_nvshenLabel];
    
    self.nvshenImage = [[UIImageView alloc]init];
    [self.contentView addSubview:_nvshenImage];
    
    _infor = [[UILabel alloc] init];
    _infor.textColor = RGB_HEX(0x666666);
    _infor.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_infor];
    [_infor mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nickNameLabel.mas_left);
        make.top.equalTo(self.nickNameLabel.mas_bottom).offset(26);
        make.right.equalTo(self.contentView.mas_right).offset(-15);
    }];
    _onlineState = [[UILabel alloc] init];
    _onlineState.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_onlineState];
    [_onlineState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-14);
        make.centerY.equalTo(self.contentView).offset(-20);
        
    }];
    _locationState = [[UILabel alloc] init];
    _locationState.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_locationState];
    [_locationState mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).offset(-38);
        make.centerY.equalTo(self.contentView).offset(-20);
        
    }];
    _locationState.textColor = _onlineState.textColor = kLightGrayColor;
    
    UIView * line = [[UIView alloc]init];
    line.backgroundColor = RGB_HEX(0xeeeeee);
    [self.contentView addSubview:line];
    
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_nickNameLabel.mas_left).offset(0);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(0);
        make.right.equalTo(self.contentView.mas_right).offset(0);
        make.height.equalTo(@0.5);
    }];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
